﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SignalR.Hubs;
using System.Threading;

namespace WebBookingApplication
{
    public class BookingHub : Hub
    {
        public void BookFlight(String from, String to)
        {
            // Book first leg
            Clients.displayMessage(String.Format("1.Booking flight: {0}-{1} ...", from, to));
            Thread.Sleep(2000);

            // Book return 
            Clients.displayMessage(String.Format("2.Booking flight: {0}-{1} ...", to, from));
            Thread.Sleep(3000);

            // Book return 
            Clients.displayMessage(String.Format("3.Booking flight: {0}-{1} ...", to, from));
            Thread.Sleep(2000);

            // Some return value
            Clients.displayMessage("4.Flight booked successfully.");
        }

      
    }
}